import React from 'react';
import LogFactory from "log/LogFactory";
import {App, Button} from "antd";
import {requestGet} from "util/request";

const log = LogFactory.getLog("RecordLogComponent");
const RecordLogComponent = () => {
    const {message} = App.useApp();
    const testUserList = () => {
        requestGet("/manager/security-user/list")
            .then(res => {
                log.debug("请求用户列表结果", res);
                if (res.success){
                    message.success("请求用户列表成功");
                }else {
                    message.error("请求用户列表失败," + res.message);
                }

            }) ;

    } ;

    const testNoAuth = async () => {
       let res = await requestGet("/manager/security-path/list").then(res => res) ;
        log.debug("请求用户列表结果", res.message);
    } ;

    return (
        <div>
            <Button type={"primary"} onClick={testUserList}>测试请求用户列表</Button>
            <p></p>
            <Button type={"primary"} onClick={testNoAuth}>测试无权限访问</Button>
        </div>
    );
};

export default RecordLogComponent;